import request from "@/utils/request";
export default {
  //1 查询章节与小节的信息  根据课程的Id进行创建
  //返回的是自定义的类型
  getAllchapterVideo(courseId) {
    return request({
      url: `/eduservice/chapter/getchapter/${courseId}`,
      method: "get"
    });
  },
  //添加章节
  addChapter(chapter) {
    return request({
      url: `/eduservice/chapter/addChapter`,
      method: "post",
      data: chapter
    });
  },
  //修改章节  根据ID查询章节
  getChapter(chapterId) {
    return request({
      url: "/eduservice/chapter/getChapter/" + chapterId,
      method: "get"
    });
  },
  //实现修改章节
  updateChapter(chapter) {
    return request({
      url: "/eduservice/chapter/updateChapter",
      method: "post",
      date: chapter
    });
  },
  //删除章节
  deleteChapter(chapterId) {
    return request({
      url: "/eduservice/chapter/deleteChapter/"+chapterId,
      method: "delete",
    });
  }
};
